﻿using System;

namespace ConsoleApp14
{
    class Program
    {
        
        

            static void Main(string[] args)
            {
                int n = Int32.Parse(Console.ReadLine());
                Hanoi(n, "TowerA", "TowerB", "TowerC");
                Console.ReadLine();
            }

            private static void Hanoi(int n, string origin, string temp, string destination)
            {
                if (n == 1)
                {
                    move(origin, destination);
                }
                else
                {
                    Hanoi(n - 1, origin, destination, temp);
                    move(origin, destination);
                    Hanoi(n - 1, temp, origin, destination);
                }
            }

            private static void move(string origin, string destination)
            {
                Console.WriteLine("Move the plate from " + origin + " to " + destination);
            }
    }
}


        

    



